<?php
class C_FileUpload extends Controller {
    var $template_mod;
    function __construct($template_mod = "general") {
        parent::__construct();
    }
    public function actionUpload(){
        global $config;
        if (is_uploaded_file($_FILES['file']['tmp_name'])) {
            //echo "File ". $_FILES['file']['name'] ." uploaded successfully.\n";
            
            move_uploaded_file ($_FILES['file']['tmp_name'], $config['patient_pic_folder'] . $_FILES['file']['name']);
            echo "success";
            return;
            
        } else {
            echo "Possible file upload attack: ";
            echo "filename '". $_FILES['file']['tmp_name'] . "'.";
            //var_dump($_FILES);
        }
        return "";
    }

}
?>